package com.weigang.test.domain.entity;

import com.weigang.util.FieldUtil;
import com.siperian.sif.message.Field;
import com.siperian.sif.message.Record;

/**
 * @author Wi Gang
 * @date 2022-09-22 17:41:30
 *
 */
public class GoodDetailInfoVo{

        
    private String DOCUMENT_CODE = "DOCUMENT_CODE";
        
    private String DATE = "DATE";
        
    private String SHOP_CODE = "SHOP_CODE";
        
    private String GOOD_CODE = "GOOD_CODE";
        
    private String NUM = "NUM";
        
    private String SALE_MONEY = "SALE_MONEY";
        
    private String COST_MONRY = "COST_MONRY";

    private Record record;

    public static String DATA_OBJECT_UID = "BASE_OBJECT.C_MATERIAL"; // PACKAGE.PKG_WS_HOTEL_PREFERENCE

    private int firstRecord;

    private int recordsToReturn;

    public GoodDetailInfoVo (){
        this.record = new Record();
        this.record.setSiperianObjectUid(DATA_OBJECT_UID);
    }

    public GoodDetailInfoVo (Record record){
        this.record = record;
        this.record.setSiperianObjectUid(DATA_OBJECT_UID);
    }


    public String getDocumentCode () {
        Field field = record.getField(DOCUMENT_CODE);
        return FieldUtil.getFieldStringValue(field);
    }

    public void setDocumentCode (String documentCode) {
        if (record.getField(DOCUMENT_CODE) == null) {
            record.setField(new Field(DOCUMENT_CODE));
        }
        record.getField(DOCUMENT_CODE).setStringValue(documentCode);
    }
    public String getDate () {
        Field field = record.getField(DATE);
        return FieldUtil.getFieldStringValue(field);
    }

    public void setDate (String DATE) {
        if (record.getField(DATE) == null) {
            record.setField(new Field(DATE));
        }
        record.getField(DATE).setStringValue(DATE);
    }
    public String getShopCode () {
        Field field = record.getField(SHOP_CODE);
        return FieldUtil.getFieldStringValue(field);
    }

    public void setShopCode (String shopCode) {
        if (record.getField(SHOP_CODE) == null) {
            record.setField(new Field(SHOP_CODE));
        }
        record.getField(SHOP_CODE).setStringValue(shopCode);
    }
    public String getGoodCode () {
        Field field = record.getField(GOOD_CODE);
        return FieldUtil.getFieldStringValue(field);
    }

    public void setGoodCode (String goodCode) {
        if (record.getField(GOOD_CODE) == null) {
            record.setField(new Field(GOOD_CODE));
        }
        record.getField(GOOD_CODE).setStringValue(goodCode);
    }
    public String getNum () {
        Field field = record.getField(NUM);
        return FieldUtil.getFieldStringValue(field);
    }

    public void setNum (String NUM) {
        if (record.getField(NUM) == null) {
            record.setField(new Field(NUM));
        }
        record.getField(NUM).setStringValue(NUM);
    }
    public String getSaleMoney () {
        Field field = record.getField(SALE_MONEY);
        return FieldUtil.getFieldStringValue(field);
    }

    public void setSaleMoney (String saleMoney) {
        if (record.getField(SALE_MONEY) == null) {
            record.setField(new Field(SALE_MONEY));
        }
        record.getField(SALE_MONEY).setStringValue(saleMoney);
    }
    public String getCostMonry () {
        Field field = record.getField(COST_MONRY);
        return FieldUtil.getFieldStringValue(field);
    }

    public void setCostMonry (String costMonry) {
        if (record.getField(COST_MONRY) == null) {
            record.setField(new Field(COST_MONRY));
        }
        record.getField(COST_MONRY).setStringValue(costMonry);
    }


    public Record toRecord() {
        return record;
    }

    public void setRecord(Record record) {
        this.record = record;
    }

    public int toFirstRecord() {
        return firstRecord;
    }

    public void setFirstRecord(int firstRecord) {
        this.firstRecord = firstRecord;
    }

    public int toRecordsToReturn() {
        return recordsToReturn;
    }

    public void setRecordsToReturn(int recordsToReturn) {
        this.recordsToReturn = recordsToReturn;
    }
}
